/**
 * 公共样式文件
 * 定义可复用的样式类
 * 避免使用 @apply 指令以兼容 Tailwind CSS v4
 */

/* 卡片相关样式 */
.card-base {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid rgb(229 231 235);
}

.card-hover {
  transition: all 0.2s;
}

.card-hover:hover {
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.card-interactive {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid rgb(229 231 235);
  transition: all 0.2s;
  cursor: pointer;
}

.card-interactive:hover {
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.1),
    0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* 按钮相关样式 */
.btn-primary {
  background-color: rgb(59 130 246);
  border-color: rgb(59 130 246);
  color: white;
  transition: all 0.2s;
}

.btn-primary:hover {
  background-color: rgb(37 99 235);
  border-color: rgb(37 99 235);
}

.btn-secondary {
  background-color: rgb(243 244 246);
  border-color: rgb(229 231 235);
  color: rgb(55 65 81);
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: rgb(229 231 235);
  border-color: rgb(209 213 219);
}

.btn-danger {
  background-color: rgb(239 68 68);
  border-color: rgb(239 68 68);
  color: white;
  transition: all 0.2s;
}

.btn-danger:hover {
  background-color: rgb(220 38 38);
  border-color: rgb(220 38 38);
}

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: rgb(75 85 99);
  transition: all 0.2s;
}

.btn-ghost:hover {
  background-color: rgb(249 250 251);
  color: rgb(31 41 55);
}

/* 文本相关样式 */
.text-primary {
  color: rgb(17 24 39);
  font-weight: 500;
}

.text-secondary {
  color: rgb(75 85 99);
}

.text-muted {
  color: rgb(107 114 128);
}

.text-success {
  color: rgb(22 163 74);
}

.text-warning {
  color: rgb(234 88 12);
}

.text-error {
  color: rgb(220 38 38);
}

/* 截断文本样式 */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* 布局相关样式 */
.container-main {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* 状态相关样式 */
.status-not-started {
  background-color: rgb(243 244 246);
  color: rgb(31 41 55);
  border-color: rgb(229 231 235);
}

.status-in-progress {
  background-color: rgb(219 234 254);
  color: rgb(30 64 175);
  border-color: rgb(191 219 254);
}

.status-completed {
  background-color: rgb(220 252 231);
  color: rgb(22 101 52);
  border-color: rgb(187 247 208);
}

/* 优先级相关样式 */
.priority-low {
  background-color: rgb(220 252 231);
  color: rgb(22 101 52);
  border-color: rgb(187 247 208);
}

.priority-medium {
  background-color: rgb(219 234 254);
  color: rgb(30 64 175);
  border-color: rgb(191 219 254);
}

.priority-high {
  background-color: rgb(254 215 170);
  color: rgb(154 52 18);
  border-color: rgb(253 186 116);
}

.priority-urgent {
  background-color: rgb(254 226 226);
  color: rgb(153 27 27);
  border-color: rgb(252 165 165);
}

/* 拖拽相关样式 */
.dragging {
  opacity: 0.5;
  transform: rotate(2deg) scale(1.05);
}

.drop-zone-active {
  background-color: rgb(239 246 255);
  border: 2px dashed rgb(147 197 253);
}

.drop-zone-hover {
  background-color: rgb(219 234 254);
  border-color: rgb(96 165 250);
}

/* 加载和空状态样式 */
.loading-spinner {
  animation: spin 1s linear infinite;
  border-radius: 50%;
  border: 2px solid rgb(209 213 219);
  border-top-color: rgb(37 99 235);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 3rem 0;
  color: rgb(107 114 128);
}

/* 表单相关样式 */
.form-section {
  padding: 1rem;
  background-color: rgb(249 250 251);
  border-radius: 0.5rem;
}

.form-section > * + * {
  margin-top: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-col {
  flex: 1;
}

/* 响应式隐藏/显示 */
.hide-mobile {
  display: none;
}

@media (min-width: 640px) {
  .hide-mobile {
    display: block;
  }
}

.show-mobile {
  display: block;
}

@media (min-width: 640px) {
  .show-mobile {
    display: none;
  }
}

.hide-tablet {
  display: none;
}

@media (min-width: 768px) {
  .hide-tablet {
    display: block;
  }
}

.show-tablet {
  display: block;
}

@media (min-width: 768px) {
  .show-tablet {
    display: none;
  }
}

/* 动画相关样式 */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.slide-up {
  transform: translateY(1rem);
  opacity: 0;
  animation: slideUp 0.3s ease-out forwards;
}

.scale-in {
  transform: scale(0.95);
  opacity: 0;
  animation: scaleIn 0.2s ease-out forwards;
}

/* 工具类 */
.truncate-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-break-all {
  word-break: break-all;
}

.select-none {
  user-select: none;
}

.pointer-events-none {
  pointer-events: none;
}

/* 自定义滚动条 */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background-color: rgb(243 244 246);
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgb(209 213 219);
  border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: rgb(156 163 175);
}

/* 自定义动画定义 */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }
}
